<div>
    <h2>My Heroes</h2>
    <ul class="heroes">
        <!-- <li *ngFor="let hero of heroes" (click)="onSelect(hero)" [class.selected]="hero === selectedHero"> -->
        <li *ngFor="let hero of heroes">
            <a routerLink="/detail/{{hero.id}}">
                <span class="badge">{{hero.id}}</span> {{hero.name}}
            </a>
            <button class="delete" title="delete hero" (click)="deleteHero(hero)">X</button>
        </li>
    </ul>
</div>
<!-- <app-hero-detail [hero]="selectedHero"></app-hero-detail> -->
<div>
    <h2>Add New Hero</h2>
    <label>Hero name:
        <input #heroName />
    </label>
    <button (click)="addHero(heroName.value);heroName.value=''">
        add
    </button>
</div>
<app-hero-search></app-hero-search>